﻿using System;

namespace ConsoleApp2
{
    class Program
    {
            static void Main(string[] args)
            {
                int g, m, x;
                for (g = 0; g <= 20; g++)
                {
                    for (m = 0; m <= 33; m++)
                    {
                        for (x = 0; x <= 100; x += 3)
                        {
                            if ((g + m + x) == 100 && (5 * g + 3 * m + x / 3) == 100)
                            {
                                Console.WriteLine("公鸡为：{0}", g);
                                Console.WriteLine("母鸡为：{0}", m);
                                Console.WriteLine("小鸡为：{0}", x);

                            }
                        }
                    }
                }
                Console.WriteLine("-------------------------");
                for (int j = 1; j <= 35; j++)
                {
                    for (int t = 1; t <= 35; t++)
                    {
                        if (j + t == 35 && j * 2 + t * 4 == 94)
                        {
                            Console.WriteLine("鸡为{0}", j);
                            Console.WriteLine("兔为{0}", t);
                        }
                    }
                }
                Console.WriteLine("------------------------------");
                int n = 1998 + 4;
            int fm = 86;
            int xd = 25;
            int gg = xd * 4 - fm;
            int mq = gg * 3;
            for (int fq =fm - mq; true; n++)
            {
                if(fq == 3 * gg)
                {
                    Console.WriteLine("父的年龄是兄的3倍时是公元：{0}年", n);
                    break;
                }
                else
                {
                    fq++;
                    gg++;
                }
            }
                
                Console.WriteLine("--------------------------");
            int sum = 52;
            int p1 = 7;
            int p5 = 6;
            int wt = 188 - 1 * p1 - 5 * p5;
            int xs = sum - 7 - 6;
                for (int p23 = 1; p23 <=xs ; p23++)
                {
                    for (int p4 = 1; p4 <= xs; p4++)
                    {
                    if ((p23 * 2 + p4)==xs&&(p23 * 5 + p4 * 4)==wt)
                    {
                        Console.WriteLine("答对四道题的人有:{0}", p4);
                    }
                    }
                }
                    



                Console.ReadKey();
            }
    }
}
